﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KoolearnSample.Model
{
    [DataContract]
    public class KoolearnExamContent : INotifyPropertyChanged
    {
        #region Members
        [DataMember(Name = "question")]
        private string question;
        [DataMember(Name = "tid")]
        private string tid;
        [DataMember(Name="answer_list")]
        private List<KoolearnExamAnswer> answerList;
        #endregion

        #region Properties
        public string Question
        {
            get { return question; }
            set { question = value; RaisePropertyChanged("Question"); }
        }
        public string Tid
        {
            get { return tid; }
            set { tid = value; RaisePropertyChanged("Tid"); }
        }
        public List<KoolearnExamAnswer> AnswerList
        {
            get { return answerList; }
            set { answerList = value; RaisePropertyChanged("AnswerList"); }
        }
        #endregion

        #region INotifyPropertyChanged Members
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion

        #region Methods
        public void RaisePropertyChanged(string name)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }
        #endregion
    }
}
